package com.hjm.friend.controller.user;


import com.hjm.common.core.controller.BaseController;
import com.hjm.common.core.domain.Result;
import com.hjm.common.core.domain.page.TableDataInfo;
import com.hjm.friend.annotation.CheckUserStatus;
import com.hjm.friend.domain.exam.dto.ExamQueryDTO;
import com.hjm.friend.domain.user.dto.UserExamDTO;
import com.hjm.friend.service.user.impl.UserExamServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/user/exam")
public class UserExamController extends BaseController {

    @Autowired
    private UserExamServiceImpl userExamService;


    @CheckUserStatus
    @RequestMapping("/enter")
    public Result<Void> enter(@RequestBody UserExamDTO userExamDTO) {
        return toResult(userExamService.enter(userExamDTO));
    }


    // 允许游客访问
    @GetMapping("/semiLogin/list")
    public TableDataInfo list(ExamQueryDTO examQueryDTO){
        return userExamService.list(examQueryDTO);
    }

}
